package magasin;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class VenteTest {
	
	private Vente vente;
	private Article article;
	private Client client;

	@Before
	public void setUp() throws Exception {
		article = new Article("TestArticle","Test",1,1);
		client = new Client("TestClient","1-450-888-8888","99 rue du Test",1);
	}

	@After
	public void tearDown() throws Exception {
		vente = null;
		article = null;
		client = null;
	}

	@Test
	public void testVente() {
		ArrayList<VenteArticle> liste = new ArrayList<VenteArticle>();
		liste.add(new VenteArticle(article, 1));
		vente = new Vente(liste, client, new StratCheque());
		
		assertTrue("La vente ne contient pas le bon nombre d'articles.", vente.getArticles().size() == 1);
		assertTrue("Le client n'est pas valide.", vente.getClient() == client);
	}

}
